/**
 * This file is part of the CAKIS project.
 * 
 * Copyright (c) 2009-2010 - Florian Arndt, Christian Kerl
 * 
 * @license GNU Lesser General Public License v3 <http://www.opensource.org/licenses/lgpl-3.0.html>
 * @since   09.05.2010
 * @version SVN: $Id: ProductQuantity.java 137 2010-05-15 10:37:43Z christian-kerl@web.de $
 */
package org.cakis.server.model;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;

/**
 * ProductQuantity
 *
 * @author Christian Kerl
 */
@Embeddable
public class ProductQuantity implements Serializable {
    private static final long serialVersionUID = 1L;

    private Float quantity;
    private Float numberOfPieces;

    private StockUnit unit;

    public Float getQuantity() {
        return quantity;
    }

    public void setQuantity(Float quantity) {
        this.quantity = quantity;
    }

    public Float getNumberOfPieces() {
        return numberOfPieces;
    }

    public void setNumberOfPieces(Float numberOfPieces) {
        this.numberOfPieces = numberOfPieces;
    }

    @ManyToOne(fetch = FetchType.EAGER, optional = true)
    public StockUnit getUnit() {
        return unit;
    }

    public void setUnit(StockUnit unit) {
        this.unit = unit;
    }
}
